import service from "@/utils/request"

export const banner=()=>{
  return service({
    method:"get",
    url:"/v1/banner",
  })
}

export const navbar=()=>{
  return service({
    method:"get",
    url:"/v1/navbar",
  })
}

// 获取宠物话题
export const getPT = () => {
  return service({
    method: "get",
    url: "/v1/getPT",
  })
}

// 获取宠物话题图片
export const getPetImg = () => {
  return service({
    method: 'get',
    url: '/v1/getPetImg'
  })
}

// 获取宠物洗护
export const getWash = () => {
  return service({
    method: 'get',
    url: '/v1/getwashing'
  })
} 

// 获取宠物洗护详情
export const getWashDetail = () => {
  return service({
    method: 'get',
    url: '/v1/getWashDetail'
  })
} 

// 获取添加宠物
export const addTopic = (data) => {
  return service({
    method: 'post',
    url: '/v1/addTopic',
    data
  })
} 
/* //删除
// 获取添加宠物
export const removeTopic = (data) => {
  return service({
    method: 'post',
    url: '/v1/removeTopic?title=毛孩,
    data
  })
}  */

export const getSearch = () => {
  return service({
    method: 'get',
    url: '/v1/getRecommend',
  })
}

//添加宠物洗护收藏
export const addCollectWash = (data) => {
  return service({
    method: 'post',
    url: '/api/v1/addCollectWash',
    data
  })
}

//删除宠物洗护收藏
export const removeCollectWash = (params) => {
  return service({
    method: 'delete',
    url: '/api/v1/removeCollectWash',
    params
  })
}
//获取宠物洗护收藏
export const getCollectWash = (params) => {
  return service({
    method: 'get',
    url: '/api/v1/getCollectWash',
    params
  })
}

// 判断用户是否已收藏宠物洗护数据
export const  isUserCollectWash = (params) => {
  return service({
    method: 'get',
    url: '/api/v1/isUserCollectWash',
    params
  })
}

//获取附近宠物
export const getAllMessage = () => {
  return service({
    method: 'get',
    url: '/v1/getAllMessage'
  })
} 

//获取宠物点赞
export const updateFanNum = (data) => {
  return service({
    method: 'put',
    url: '/v1/updateFanNum',
    data
  })
} 
// 更新topic表中的tid
export const update = (data) => {
  return service({
    method: 'put',
    url: '/v1/updateImgsTopic',
    data
  })
}

